package com.back.end.Dao;

import com.back.end.Modal.ProductChild;
import com.back.end.Modal.CategoriesChild;
import com.back.end.Modal.Sales;
import org.apache.ibatis.annotations.Mapper;

import java.sql.Timestamp;
import java.util.List;

@Mapper
public interface WebProductDao {
    public List<ProductChild> getProductList();

    public ProductChild getProductChildById(int id);

    public ProductChild getProductChildByName(String name);

    public List<CategoriesChild> getProductTypes();

    public CategoriesChild getCategoryById(Integer id);

    public void updateCategory(Integer id, String name, Timestamp createdTime, Timestamp updatedTime);

    public void addCategory(CategoriesChild category);

    public CategoriesChild getCategoryByName(String name);

    public void addProduct(ProductChild productChild);

    public void updateProduct(int id, String name, int typeId, String type, double price, String detail, String imagePath, String productCode);

    public void dealProduct(int id, String status);

    public int getSalesFormTime();

    public Integer getSalesLastWeekById(int productId);

    public Integer getSalesMonthById(int productId);

    public Integer getSalesLastMonthById(int productId);

    public List<Sales> getSalesLastWeek();

    public List<Sales> getSalesMonth();

    public List<Sales> getSalesLastMonth();


}
